package com.kangaroo.myhome.controller;

import com.kangaroo.myhome.service.impl.MenuService;
import com.kangaroo.myhome.service.impl.UserLoginInfoService;
import com.kangaroo.myhome.vo.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName UserLoginInfo
 * @Description TODO
 * @Author kangaroo
 * @Date 2020/8/4 2:14
 * @Version 1.0
 **/
@RestController
@RequestMapping("userLoginInfo")
public class UserLoginInfoController {

    @Autowired
    private UserLoginInfoService userLoginInfoService;

    // @PreAuthorize("hasAuthority('sys:user:view')")
    @GetMapping(value = "/findAll")
    public ResponseModel findAll(HttpServletRequest request) {
        String workNo = request.getParameter("account");
        String ip = request.getParameter("ip");
        String pageS = request.getParameter("page");
        String rowsS = request.getParameter("rows");
        int page = Integer.parseInt(pageS);
        int rows = Integer.parseInt(rowsS);
        return userLoginInfoService.findAll(workNo, ip, page, rows);
    }

}
